import * as dbFunc from './db'
import * as isAdmin from './isAdmin'

export default () => {
  return async (ctx, next) => {
    for (let v in dbFunc) {
      if (dbFunc.hasOwnProperty(v)) ctx[v] = dbFunc[v]
    }
    for (let w in isAdmin) {
      if (isAdmin.hasOwnProperty(w)) ctx[w] = isAdmin[w]
    }
    await next()
  }
}
